home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_ctdoor.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  111 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shs_CTdoor.cog     Make the clock tower door open/close.  
  4. #
  5. # [JWC]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message startup
  15.  
  16. sector  CTsector
  17.  
  18. thing   CTdoor                            # Clock Tower door 
  19. thing   CTbutton                
  20. thing   player              local
  21. thing    interpCam
  22.  
  23. int        position=0            local
  24.  
  25. cog        NoWorkTalkcog
  26.  
  27. end
  28.  
  29. # ========================================================================================
  30.  
  31. code
  32.  
  33. startup:
  34.  
  35.     #turn off door sector
  36.     SetSectorAdjoins(CTsector, 0);
  37.     player= GetLocalPlayerThing();
  38.     return;
  39.  
  40. activated:
  41.     
  42.     if (GetCurItem(player) != 0) return; # prevents activating with chalk
  43.  
  44.     if (GetSenderRef() != CTbutton) return;
  45.  
  46.     SetActorFlags(player, 0x200000);
  47.     StartCutscene(0);
  48.     StopThing(player);
  49.     DeselectWeapon(player);
  50.     DeselectWeaponWait(player);
  51.         
  52.     SetExtCamOffsetToThing(interpCam);
  53.     
  54.     PlayMode(player, 60, 0);
  55.  
  56.     # synch with button
  57.     Sleep(.3);
  58.  
  59.     # door button goes in  
  60.     MoveToFrame(CTbutton, 1, 1); 
  61.     WaitForStop(CTbutton);
  62.  
  63.       
  64.     if (global3 == 1) // We're being told that the clock is now powered, so start things up!
  65.     {
  66.         SetSectorAdjoins(CTsector, 1);
  67.         
  68.         # check door position
  69.         if (position == 0)            # 0 = door closed
  70.         {
  71.             # open door 
  72.             Rotate(CTdoor, 90, 1, 1);
  73.             WaitForStop(CTdoor);
  74.             position=1;                # 1 = door open
  75.         }
  76.         else
  77.         {
  78.             # close door
  79.             Rotate(CTdoor, -90, 1, 1);
  80.             WaitForStop(CTdoor);
  81.             SetSectorAdjoins(CTsector, 0);
  82.             position=0;
  83.         }
  84.     }
  85.     
  86.     if (global3 == 0)    // We're being told that the clock is no longer powered. 
  87.     {
  88.         # Call NoWorkTalkCog
  89.         Sleep(.3);
  90.         SendMessageEx(NoWorkTalkCog, user1, 0, 0, 0, 0);
  91.         global15 = 0; # per Randy
  92.         while (global15 == 0)
  93.         {
  94.             Sleep(0.01); # wait for line to finish
  95.         }
  96.     }
  97.     
  98.     # door button comes out
  99.     MoveToFrame(CTbutton, 0, 1); 
  100.     WaitForStop(CTbutton);
  101.     
  102.     RestoreExtCam();
  103.     ClearActorFlags(player, 0x200000);
  104.     EndCutscene();
  105.     return;
  106.  
  107.  
  108.  
  109. end
  110.  
  111.